Skip to content

Conversation

@paulbakker
Copy link
Contributor

This branch builds against Spring Boot 4 / Spring Framework 7.

The main changes are:

  1. AutoConfiguration has be restructured in Spring Boot. This primarily affects tests in Spring AI.
  2. Spring-retry is now part of Spring Framework, but with an updated API
  3. HttpHeaders no longer implements MultiMap. I updated Spring AI to use HttpHeaders directly.
  4. Elastic search now uses the Rest5Client

There are a few TODOs in this PR, mostly related to some open issues in Spring Boot with the restructuring of RestClient/WebClient. I'll update the PR once the next milestone or RC comes out.

This should not be merged yet since Spring Boot 4 isn't released yet, but it would be very useful to have a seperate release targetting Boot 4 / Spring Framework 7.

@ilayaperumalg ilayaperumalg changed the title Spring Boot 4 compatibility [Do Not Merge Yet] Spring Boot 4 compatibility Oct 21, 2025
@ilayaperumalg
Copy link
Member

@paulbakker Thanks very much for the PR!

Signed-off-by: Paul Bakker <pbakker@netflix.com>
Signed-off-by: Paul Bakker <pbakker@netflix.com>
@paulbakker
Copy link
Contributor Author

Note that I have disabled the models/spring-ai-huggingface module for now since it relies on Swagger codegen that I think requires work on the codegen side.

@paulbakker
Copy link
Contributor Author

paulbakker commented Oct 22, 2025

@ilayaperumalg Would it be possible to get a milestone or snapshot release based on this branch for folks preparing for the Spring Boot 4 release? It's currently one of the blockers.

The dual release (and rebasing of this branch) will likely have to continue for the next several months, so it's worth thinking this through a bit more.

I was also discussing this on Slack with Mark: https://spring-ai-community.slack.com/archives/C08FB2N8M53/p1761155506523019?thread_ts=1760565021.498989&cid=C08FB2N8M53

@ilayaperumalg
Copy link
Member

@paulbakker Thanks for following up on this. I agree that we can create a new branch along side main to have the changes required for Spring Boot 4 compatibility which can then become main when we switch to Spring AI 2.0. Until then, we can start publishing snapshot from the interim branch. I hope this works out ok for you.

I am marking this for "discussion" with the team and I'll update here once we make the decision on this(sooner).

@ericbottard ericbottard marked this pull request as draft October 29, 2025 15:17
bedrin added a commit to OncoSteps/spring-ai that referenced this pull request Oct 31, 2025
- Updated Spring Boot dependency to 4.0.0.RC1
- Spring Framework 7 API compatibility (see below)
- Migration to Spring Boot 4.x as per https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide :
  * Adopt new modular design of starters
  * Use new Jackson 3.x API
  * Support Property Mapper API changes around null handling
  * Migrated from Spring Retry to Spring Framework Retry functionality
- Updated Swagger codegen templates used by huggingface model to align with latest Spring Framework APIs
- Update elasticsearch test container to 9.2.0
- Added `FailureDetectingExternalResource` from old versions of `testcontainers` library to support `gemfire-testcontainers`
- Other related dependencies updates:
  * TestContainers to 2.0.1
  * GemFire testcontainers to 2.3.3
  * opensearch-testcontainers to 4.0.0
  * Rest Assured to 5.5.6
  * swagger-codegen-maven-plugin to 3.0.75

Fixes spring-projectsGH-3379 (spring-projects#3379)

Includes changes by @paulbakker from spring-projects#4681

Built on-top of spring-projects#4771
- Use only Spring Framework APIs available both in 6.x and 7.x branches
- Add constructors without logic to `*Api` classes in `models` modules to simplify extensibility; effective final fields are marked as final
- Kotlin 2.x support; use kotlin compiler version 2.2.21
- Update MCP SDK to 0.15.0
- Update MCP Annotations to 0.6.0

Future tasks:
- [x] Raise issue to migrate from Spring Retry to Spring Framework 7 built-in retry functionality: spring-projects#4681
- [ ] Raise issue with `swagger-codegen-maven-plugin` to support Spring Framework 7
- [x] Raise issue with GemFire to support testcontainers 2.x: gemfire/gemfire-testcontainers#7

Signed-off-by: Dmitry Bedrin <dmitry.bedrin@gmail.com>
@mpalourdio
Copy link

@ilayaperumalg Would it be possible to get a milestone or snapshot release based on this branch for folks preparing for the Spring Boot 4 release? It's currently one of the blockers.

Would be very helpful here too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants